package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Appconfig struct {
	Mysql struct {
		User     string
		Password string
		Host     string
		Port     int
		Database string
	}
	Redis struct {
		Addr    string
		Passwor string
		DB      int
	}
}

var GetViperData Appconfig

func GetViperConfig() {
	viper.SetConfigFile("/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	err = viper.Unmarshal(&GetViperData)
	if err != nil {
		panic(err)
	}
	fmt.Println(&GetViperData)
}
